package cn.yunyichina.provider.message.entity;

import java.util.Map;

import cn.yunyichina.provider.iface.entity.message.RegNotifyVo;
import cn.yunyichina.utils.convert.JsonUtils;
/**
 * 医疗挂号通知
 */
public class RegNotify extends RegNotifyVo {
	
	public RegNotify () {
		
	}
	public RegNotify parse(String strJson) {
		return JsonUtils.parseObject(strJson, RegNotify.class);
	}
	public RegNotify parse(String strJson,Map<String,Object> hosInfo,Map<String,Object> deptInfo,Map<String,Object> doctorInfo) {
		RegNotify regNotify = JsonUtils.parseObject(strJson, RegNotify.class);
		regNotify.setHosInfo(JsonUtils.parseObject(hosInfo, HosInfo.class));
		regNotify.setDeptInfo(JsonUtils.parseObject(deptInfo, DeptInfo.class));
		regNotify.setDoctorInfo(JsonUtils.parseObject(doctorInfo, DoctorInfo.class));
		
		return regNotify;
	}
	public static void main(String[] argv) {
		RegNotify regNotify = new RegNotify();
		regNotify.setOperate("aaa");
		regNotify.setTreatDate("2017-03-23 10:00:00");
		regNotify.setBizType("CREATE");
		regNotify.setUserId("zhangSan");
		regNotify.setPatientName("huanghh");
		regNotify.setOrderLink("www.yunyi.cn");
		DoctorInfo di = new DoctorInfo();
		di.setCode("001");
		di.setName("张医生");
		di.setSex("F");
		DeptInfo dc = new DeptInfo();
		dc.setCode("dept002");
		dc.setLocation("西楼208");
		dc.setName("放射科");
		regNotify.setDeptInfo(dc);
		HosInfo hosInfo = new HosInfo();
		hosInfo.setCode("hos001");
		hosInfo.setName("港大");
		hosInfo.setPhone("13988886666");
		regNotify.setHosInfo(hosInfo);
		
		regNotify.setDoctorInfo(di);
		System.out.println(JsonUtils.toJsonString(regNotify));
		RegNotify newNotify = JsonUtils.parseObject(regNotify, RegNotify.class);
		System.out.println(newNotify.getDoctorInfo().getCode());
		System.out.println(JsonUtils.toJsonString(newNotify));
	}
}

